package org.aplikator.client.shared.descriptor;

import org.aplikator.client.local.widgets.HasFields;
import org.aplikator.client.local.widgets.LabelFieldWidget;

import com.google.gwt.user.client.ui.Widget;
import org.jboss.errai.common.client.api.annotations.Portable;

@SuppressWarnings("serial")
//@Portable
public class LabelFieldDTO extends WidgetPropertyDTOBase implements RenderWidgetAware {

	public static final String TYPE_KEY = "label";

    @SuppressWarnings("unused")
    public LabelFieldDTO() {   //TODO custom marshaller
    }

    public LabelFieldDTO(PropertyDTO property) {
        super(property);
    }

    @Override
    public Widget getWidget(HasFields form) {
        LabelFieldWidget field = new LabelFieldWidget(property.getLocalizedName(), property);
        form.registerDataField(field);
        return field;
    }

}
